﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using ECare.BUS.Data;
using ECare.BUS;

namespace ECare.Client.controls
{
    public partial class ucInCheckInfo : UserControl
    {
        public ucInCheckInfo()
        {
            InitializeComponent();
        }

        public SupplyInfo CurrentSupply { get; set; }

        public void LoadInformation()
        { 
           // this.lblCheckStatus
            if (CurrentSupply.supply_checkstatus == CheckStatus.Confirmed)
            {
                this.lblCheckStatus.Text = string.Format(this.lblCheckStatus.Text, "检验合格");
                this.lblCheckStatus.ForeColor = Color.Green;
            }
            else if(CurrentSupply.supply_checkstatus==CheckStatus.Failed)
            {
                this.lblCheckStatus.Text = string.Format(this.lblCheckStatus.Text, "检验不合格");
                this.lblCheckStatus.ForeColor = Color.Red;
            }
            else if (CurrentSupply.supply_checkstatus == CheckStatus.UnChecked)
            {
                this.lblCheckStatus.Text = string.Format(this.lblCheckStatus.Text, "未检查");
         //       this.lblCheckStatus.ForeColor = Color.Red;
            }
            else if (CurrentSupply.supply_checkstatus == CheckStatus.UnChecked)
            {
                this.lblCheckStatus.Text = string.Format(this.lblCheckStatus.Text, "检查未完成");
                //       this.lblCheckStatus.ForeColor = Color.Red;
            }
            else
            {
 
            }

            if (CurrentSupply.HasStorage)
            {
                this.lblStorage.Text = "已经生成有效库存.";
            }
           

            this.lblCheckInfo.Text = string.Format(this.lblCheckInfo.Text,UserInfoHelper.GetUserNameById(CurrentSupply.supply_check_by),CurrentSupply.supply_check_time);
            this.lblCheckReamrk.Text = string.Format(this.lblCheckReamrk.Text, CurrentSupply.supply_check_remark);

        }
    }
}
